<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
          "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>QUnit for 'ecparam-1.0.js'</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="qunit.js"></script>
<link rel="stylesheet" href="qunit.css" type="text/css" media="screen" />

<script src="../ext/cj/cryptojs-312-core-fix.js"></script>
<script src="../ext/cj/x64-core.js"></script>
<script src="../ext/cj/cipher-core_min.js"></script>
<script src="../ext/cj/aes_min.js"></script>
<script src="../ext/cj/tripledes_min.js"></script>
<script src="../ext/cj/enc-base64_min.js"></script>
<script src="../ext/cj/md5_min.js"></script>
<script src="../ext/cj/sha1_min.js"></script>
<script src="../ext/cj/sha256_min.js"></script>
<script src="../ext/cj/sha224_min.js"></script>
<script src="../ext/cj/sha512_min.js"></script>
<script src="../ext/cj/sha384_min.js"></script>
<script src="../ext/cj/ripemd160_min.js"></script>
<script src="../ext/cj/hmac_min.js"></script>
<script src="../ext/cj/pbkdf2_min.js"></script>


<script src="../ext/jsbn.js"></script>
<script src="../ext/jsbn2.js"></script>
<script src="../ext/prng4.js"></script>
<script src="../ext/rng.js"></script>
<script src="../ext/ec.js"></script>
<script src="../ext/ec-patch.js"></script>

<script src="../src/base64x-1.1.js"></script>
<script src="../src/asn1hex-1.1.js"></script>
<script src="../src/asn1-1.0.js"></script>
<script src="../src/crypto-1.1.js"></script>
<script src="../src/ecdsa-modified-1.0.js"></script>
<script src="../src/ecparam-1.0.js"></script>

<script type="text/javascript">
$(document).ready(function(){

test("ECParameterDB NIST P-256", function() {
  var db = KJUR.crypto.ECParameterDB;
  expect(6);
  equal(typeof db.getByName("secp256r1"), "object", "secp256r1 defined");
  equal(typeof db.getByName("NIST P-256"), "object", "alias NIST P-256 defined");
  equal(typeof db.getByName("P-256"), "object", "alias P-256 defined");
  equal(typeof db.getByName("prime256v1"), "object", "alias prime256v1 defined");
  var ecparam = db.getByName("prime256v1");
  equal(ecparam['n'].toString(16), "ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", "prime256v1:n = ");
  equal(ecparam.keycharlen, 64, "prime256v1:keycharlen = ");
});

test("ECParameterDB NIST P-384", function() {
  var db = KJUR.crypto.ECParameterDB;
  expect(4);
  equal(typeof db.getByName("secp384r1"), "object", "secp384r1 defined");
  equal(typeof db.getByName("NIST P-384"), "object", "alias NIST P-384 defined");
  equal(typeof db.getByName("P-384"), "object", "alias P-384 defined");
  var ecparam = db.getByName("secp384r1");
  equal(ecparam.keycharlen, 96, "secp384r1:keycharlen = ");
});

test("ECParameterDB NIST P-521", function() {
  var db = KJUR.crypto.ECParameterDB;
  expect(4);
  equal(typeof db.getByName("secp521r1"), "object", "secp521r1 defined");
  equal(typeof db.getByName("NIST P-521"), "object", "alias NIST P-521 defined");
  equal(typeof db.getByName("P-521"), "object", "alias P-521 defined");
  var ecparam = db.getByName("secp521r1");
  equal(ecparam.keycharlen, 132, "secp521r1:keycharlen = ");
});

});
</script>
  
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture">test markup</div>

<p>
ECC related QUnit test pages: 
<a href="qunit-do-crypto.html">crypto.js</a> | 
<a href="qunit-do-crypto-ecdsa.html">crypto.js Signature class for ECDSA</a> | 
<a href="qunit-do-ecdsamod.html">ecdsa-modified.js</a> | 
<a href="qunit-do-ecparam.html">ecparam.js</a> | 
</p>

</body>
</html>
